#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 1e3+10;

db a[N][N],f[N];
int n,m,x,y;

void build(){
	if(m == 1){
		a[1][1] = -1.0 / 2; a[1][m+1] = -f[1] / 2 - 1;return;
	}
	a[1][1] = -2.0 / 3; a[1][2] = 1.0 / 3; a[1][m + 1] = -f[1] / 3 - 1;
	a[m][m] = -2.0 / 3; a[m][m-1] = 1.0 / 3; a[m][m+1] = -f[m] / 3 - 1;
	for(int i = 2;i < m;i++)
		a[i][i] = -3.0 / 4,a[i][i+1] = 1.0 / 4,a[i][i-1] = 1.0 / 4,a[i][m+1] = -f[i] / 4 - 1;
}

void Guass(){
	for(int i = 1;i < m;i++){
		db t = a[i + 1][i] / a[i][i];
		a[i + 1][i] -= t * a[i][i]; a[i + 1][i + 1] -= t * a[i][i + 1]; a[i + 1][m+1] -= t * a[i][m + 1];
	}
	f[m] = a[m][m+1] / a[m][m];
	for(int i = m - 1;i >= 1;i--)
		f[i] = (a[i][m + 1] - f[i + 1] * a[i][i + 1]) / a[i][i];
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in; x = in,y = in;
	for(int i = n - 1;i >= x;i--) build(), Guass();
	printf("%.8lf",f[y]);
	return 0;
}

